﻿/***********************************************************************************************************************************
 *    Name: sp_subscription_cleanup.sql
 *  Author: Frank Figearo — http://www.sqlnerd.me/ — frank@sqlnerd.me
 * Summary: 
**/
DECLARE @tsql NVARCHAR(MAX) = N'';
SELECT @tsql+= N'EXECUTE sp_subscription_cleanup ''' + publisher + N''', ''' + publisher_db + N''', ''' + publication + N''';' FROM dbo.MSreplication_subscriptions;
EXECUTE (@tsql);